<?php

/**
 * Created by PhpStorm.
 * User: yanshinian@yeah.net
 * Date: 2019/5/22
 * Time: 17:51.
 * pdd.ddk.goods.zs.unit.url.gen
 */
class DdkGoodsZsUnitUrlGenRequest
{
    /**
     * @var STRING  渠道id
     */
    private $pid;
    /**
     * @var LONG  需转链的链接
     */
    private $source_url;
    /**
     * @var int  自定义参数，为链接打上自定义标签；自定义参数最长限制64个字节；格式为： {"uid":"11111","sid":"22222"} ，其中 uid 用户唯一标识，可自行加密后传入，每个用户仅且对应一个标识，必填； sid 上下文信息标识，例如sessionId等，非必填。该json字符串中也可以加入其他自定义的key
     */
    private $custom_parameters;
    

    private $apiParas = array();

    public function setPid($pid)
    {
        $this->pid = $pid;
        $this->apiParas['pid'] = $pid;
    }

    public function getPid()
    {
        return $this->pid;
    }

    public function setSourceUrl($source_url)
    {
        $this->source_url = $source_url;
        $this->apiParas['source_url'] = $source_url;
    }

    public function getSourceUrl()
    {
        return $this->source_url;
    }

    public function setCustomParameters($custom_parameters)
    {
        $this->custom_parameters = $custom_parameters;
        $this->apiParas['custom_parameters'] = $custom_parameters;
    }

    public function getCustomParameters()
    {
        return $this->custom_parameters;
    }

    public function getApiMethodName()
    {
        return 'pdd.ddk.goods.zs.unit.url.gen';
    }

    public function getApiParas()
    {
        return $this->apiParas;
    }

    public function check()
    {
        RequestCheckUtil::checkNotNull($this->pid,"pid");
        RequestCheckUtil::checkNotNull($this->source_url,"source_url");
    }

    public function putOtherTextParam($key, $value)
    {
        $this->apiParas[$key] = $value;
        $this->$key = $value;
    }
}
